package com.cjb.cloudwxpusher.test;

import com.zjiecode.wxpusher.client.WxPusher;
import com.zjiecode.wxpusher.client.bean.Message;
import com.zjiecode.wxpusher.client.bean.MessageResult;
import com.zjiecode.wxpusher.client.bean.Result;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author chenjinbin
 * @Package IntelliJ IDEA
 * @Class test
 * @Date 2024-03-17 23:11
 */
@Service
public class test {

    // 替换成你的appToken
    private final String appToken = "your_app_token";

    public static void main(String[] args) {
        Message message = new Message();
        message.setTopicId(27442L);
        message.setAppToken("AT_9GPt9gfeqysslP3KBuMfGxaNLt3aHpQF");
        message.setContentType(Message.CONTENT_TYPE_TEXT);
        message.setContent("不加限制的自由是很可怕的，因为很容易让任何人滑向深渊。");
        message.setUrl("http://wxpuser.zjiecode.com");//可选参数
        Result<List<MessageResult>> result = WxPusher.send(message);
        System.out.println(result.isSuccess());
    }
}
